home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / ifp1s158.zip / IFPRUN.PAS < prev    next >
Pascal/Delphi Source File  |  1993-06-26  |  4KB  |  181 lines

  1. unit ifprun;
  2.  
  3. interface
  4.  
  5. uses crt, dos, ifpglobl, ifpcomon, ifpinit, ifpscrpt, ifphelp,
  6.   page_00, page_01, page_02, page_03, page_04, page_05, page_06, page_07,
  7.   page_08, page_09, page_10, page_11, page_12, page_13, page_14, page_15,
  8.   page_16, page_17, page_18, page_19, page_20, page_21;
  9.  
  10. procedure runit;
  11.  
  12. implementation
  13.  
  14. procedure runit;
  15.   begin
  16.   with regs do
  17.     begin
  18.     AX:=$3306;
  19.     MsDos(regs);
  20.     if (AL = $06) and (BH < 100) and (BL >= 5) then
  21.       xword:=BX
  22.     else
  23.       xword:=DosVersion;
  24.     end;
  25.   osmajor:=Lo(xword);
  26.   osminor:=Hi(xword);
  27.   if osmajor >= 3 then
  28.     begin
  29.     init;
  30.     xbool1:=false;
  31.     repeat
  32.       pagenameclr;
  33.       GotoXY(x1, tlength);
  34.       TextColor(lightgray);
  35.       Write(pg:2, ' - ');
  36.       Write(pgnames[pg]);
  37.       Window(1, 3, twidth, tlength - 2);
  38.       Clrscr;
  39.       case pg of
  40.     0 : page00;
  41.     1 : page01;
  42.     2 : page02;
  43.     3 : page03;
  44.     4 : page04;
  45.     5 : page05;
  46.     6 : page06;
  47.     7 : page07;
  48.     8 : page08;
  49.     9 : page09;
  50.     10 : page10;
  51.     11 : page11;
  52.     12 : page12;
  53.     13 : page13;
  54.     14 : page14;
  55.     15 : page15;
  56.     16 : page16;
  57.     17 : page17;
  58.     18 : page18;
  59.         19 : page19;
  60.         20 : page20;
  61.         21 : page21
  62.       end;
  63.       xbool2:=false;
  64.       repeat
  65.         Window(1, 1, twidth, tlength);
  66.         GotoXY(x2 - 1, tlength);
  67.         quiet:=false;
  68.         if PrinterRec.Mode <> 'A' then
  69.           begin
  70.           if not endit then
  71.             begin
  72.             repeat
  73.             until KeyPressed;
  74.             xchar1:=ReadKey;
  75.             if KeyPressed then
  76.               xchar2:=ReadKey
  77.             else
  78.               xchar2:=#0;
  79.             end
  80.           else
  81.             begin
  82.             endit:=false;
  83.             xchar1:=c2[1];
  84.             if Length(c2) = 1 then
  85.               xchar2:=#0
  86.             else
  87.               xchar2:=c2[2]
  88.             end;
  89.           end
  90.         else
  91.           begin
  92.           ScreenPrint(Pg, PgNames[Pg], VerNum);
  93.           xchar1:=#0;
  94.           if Pg = PgMax then
  95.             begin
  96.             PrinterRec.Mode:='S';
  97.             xchar2:=#71;
  98.             end
  99.           else
  100.             xchar2:=#81
  101.           end;
  102.         if (xchar1 = #27) and (xchar2 = #0) then
  103.           begin
  104.           xbool2:=true;
  105.           xbool1:=true
  106.           end;
  107.         if (xchar1 = #13) and (xchar2 = #0) then
  108.           begin
  109.           pagenameclr;
  110.           GotoXY(x1, tlength);
  111.           TextColor(White);
  112.           Write('Go to page no.=> ');
  113.           i:=getnum;
  114.           if (i >= 0 ) and (i <= pgmax) then
  115.             begin
  116.             pg:=i;
  117.             xbool2:=true
  118.             end;
  119.           if i = 999 then
  120.             xbool2:=true;
  121.           pagenameclr;
  122.           GotoXY(x1, tlength);
  123.           TextColor(lightgray);
  124.           Write(pg:2, ' - ');
  125.           Write(pgnames[pg]);
  126.           end;
  127.         if xchar1 = #0 then
  128.           case xchar2 of
  129.             #71: begin
  130.                  xbool2:=true;
  131.                  pg:=0
  132.                  end;
  133.             #73: if pg > 0 then
  134.                    begin
  135.                    xbool2:=true;
  136.                    Dec(pg)
  137.                    end;
  138.             #79: begin
  139.                  xbool2:=true;
  140.                  pg:=pgmax
  141.                  end;
  142.             #81: if pg < pgmax then
  143.                    begin
  144.                    xbool2:=true;
  145.                    Inc(pg)
  146.                    end;
  147.             #25: begin
  148.                  screenprint(pg, pgnames[pg], vernum);
  149.                  xbool2:=false;
  150.                  quiet:=true;
  151.                  end;
  152.             #59: begin
  153.                  helpscreen(pg, helpversion);
  154.                  xbool2:=false;
  155.                  quiet:=true;
  156.                  end;
  157.           end;
  158.       if (not xbool2) and (not quiet) then
  159.         begin
  160.         Sound(220);
  161.         Delay(100);
  162.         NoSound
  163.         end
  164.       until xbool2
  165.     until xbool1;
  166.     TextAttr:=attrsave;
  167.     if resetvideo then
  168.       TextMode(vidmode);
  169.     ClrScr
  170.     end
  171.   else
  172.     begin
  173.     Writeln;
  174.     decimal:='.';
  175.     Writeln('INFOPLUS requires DOS version 3.0 or later');
  176.     Write('Your DOS version is ');
  177.     showvers
  178.     end
  179.   end;
  180. end.
  181.